package com.englisheveryday.activity;

import com.englisheveryday.constants.Constants;
import com.englisheveryday.utils.L;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.widget.Toast;

public class SimpleMediaPlayerReceiver extends BroadcastReceiver {

	private Handler handler;
	
	public SimpleMediaPlayerReceiver(Handler handler){
		this.handler = handler;
	}
	
	@Override
	public void onReceive(Context context, Intent intent) {
		L.d("receive1");
		String id = intent.getStringExtra("id");
		Toast.makeText(context,"id"+id, Toast.LENGTH_SHORT).show();
		Bundle b = new Bundle();
		b.putString("id",id);
		Message msg = handler.obtainMessage();
		msg.setData(b);
		msg.what = Constants.HANDLER_PLAYLIST_CHECKED;
		handler.sendMessage(msg);
	}

}
